function Cartesian(start: any[], end: any[]): any[] {
	let tmp: any[] = [];
	for (let i = 0; i < start.length; i++) {
		for (let j = 0; j < end.length; j++) {
			if (typeof start[i] === 'object') {
				tmp.push([...start[i], end[j]]);
			} else {
				tmp.push([start[i], end[j]]);
			}
		}
	}
	return tmp;
}

export function multiCartesian(data: any[]) {
	let len: number = data.length;
	if (len == 0) return [];
	else if (len == 1) return data[0];
	else {
		let result = data.reduce(Cartesian);
		return result;
	}
}
